battleUI = {}

battleUI.loadBattleUI = function ()
	AddMousePointer("cursor", 32, 32)
	AnimateMousePointer("pointer")
	
	AddRect("StatsBox", 550, 600, 450, 150)
	AddRect("ActionsBox", 20, 580, 200, 170)
	
	vals = StringArray(3)
	vals[0] = "Muovi"
	vals[1] = "Attacca"
	vals[2] = "Oggetto"
	AddMenu("ActionsMenu", "battleEngine.ActionsMenuReturn", uisettings.defaultFont, 21, Color(255,255,255,255), Color(100,100,100,255), 50, 600, 250, 40, 0, vals)
	
	AddCustomPlugin("main", "MYSPlugin.GridDraw", "grid", battleEngine.battleData.hexSize)
end

battleUI.PlaceNPC = function (name, sprite, width, height, gx, gy, offsetY, offsetX, offsetZ)
	endPos = GetCenterCoord(gx, gy, battleEngine.battleData.hexSize, offsetY)
	endPos = SumVector3(endPos, Vector3(offsetX, 0, offsetZ))
	AddNPCCameraFacing(name, sprite, width, height, endPos, "", "")	
end

battleUI.MoveNPC = function (name, gx, gy, offsetY, offsetX, offsetZ)
	endPos = GetCenterCoord(gx, gy, battleEngine.battleData.hexSize, offsetY)
	endPos = SumVector3(endPos, Vector3(offsetX, 0, offsetZ))
	MoveNPC(name, endPos)
end

battleUI.LerpMoveNPC = function (name, gx, gy, offsetY, tbegin, tend, offsetX, offsetZ)
	endPos = GetCenterCoord(gx, gy, battleEngine.battleData.hexSize, offsetY)
	endPos = SumVector3(endPos, Vector3(offsetX, 0, offsetZ))
	LerpMoveNPC(name, GetNPC(name).sprite.sceneNode.Position, endPos, tbegin, tend)
end